package com.ruoyi.system.domain.HUAWEI;

import cn.hutool.core.date.DateUtil;
import com.ruoyi.system.domain.MES.DataCollection;
import com.ruoyi.system.domain.function.ProdOrder;
import lombok.Data;

import java.util.Date;

/**
 * @description: 条码属性回传实体类
 * @author: zhengxiong.jiang
 * @createDate: 2025-04-15
 * @version: 1.0
 */
@Data
public class SubmitBarcodeReleationDTO {

    private String emsTransID;
    private String organizationID;
    private String po;
    private String itemNumber;
    private String itemVer;
    private String emsCode;
    private String vendorId;
    private String sn;
    private String barcode2d;
    private String coo;
    private String updatedBy;
    private String updatedDate;
    private String createdBy;
    private String createdDate;
    private String attribute1;
    private String attribute2;
    private String attribute3;
    private String attribute4;
    private String attribute5;
    private String segment1;
    private String segment2;
    private String segment3;
    private String segment4;
    private String segment5;
    private String roshFlag;
    private String type;

    public SubmitBarcodeReleationDTO() {

    }

    public SubmitBarcodeReleationDTO(String H4, ProdOrder prodOrder, DataCollection ction) {
        this.emsTransID = H4;
        this.organizationID = "157";
        this.po = prodOrder.getTaskTon();
        this.itemNumber = ction.getFProdCodeNo();
        this.itemVer = "";
        this.emsCode = "H4";
        this.vendorId = "22827731";
        this.sn = ction.getFNumber();
        this.barcode2d = "";
        this.coo = "CN";
        this.updatedBy = "";
        this.updatedDate = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
        this.createdBy = ction.getFAccount() + "/" + ction.getFUserName();
        this.createdDate = ction.getFDate();
        this.attribute1 = "";
        this.attribute2 = "";
        this.attribute3 = "";
        this.attribute4 = "";
        this.attribute5 = prodOrder.getTaskTon();
        this.segment1 = "40033";
        this.segment2 = "1D";
        this.segment3 = "";
        this.segment4 = "";
        this.segment5 = "";
        this.type = "";
        this.roshFlag = "Y";
    }

    public SubmitBarcodeReleationDTO(EmsBarcodeAttribute bute) {
        this.emsTransID = bute.getEmsTransId();
        this.organizationID = "157";
        this.po = bute.getPo();
        this.itemNumber = bute.getItemNumber();
        this.itemVer = "";
        this.emsCode = "H4";
        this.vendorId = "22827731";
        this.sn = bute.getSn();
        this.barcode2d = "";
        this.coo = "CN";
        this.updatedBy = "";
        this.updatedDate = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
        this.createdBy = bute.getCreatedBy();
        this.createdDate = DateUtil.format(bute.getCreatedDate(), "yyyy-MM-dd HH:mm:ss");
        this.attribute1 = "";
        this.attribute2 = "";
        this.attribute3 = "";
        this.attribute4 = "";
        this.attribute5 = bute.getAttribute5();
        this.segment1 = "40033";
        this.segment2 = "1D";
        this.segment3 = "";
        this.segment4 = "";
        this.segment5 = "";
        this.type = "";
        this.roshFlag = "Y";
    }

}
